fix: primitive vec fast-path skip bug + release 0.10.26#720
Merged
Conversation
When decoding a trailing/extra argument that is a primitive vector, `deserialize_ignored_any` relies on `expect_type`/`wire_type` being set to the element type. The fast path introduced in #712 skipped setting these, causing `deserialize_ignored_any` to see the outer `Vec<T>` type and attempt to decode a nested vector instead of a scalar, corrupting the byte stream. Fix: always set `expect_type`/`wire_type` to the element type before calling `seed.deserialize`, and only skip `add_cost(3)` in the fast path. The `primitive_impl!` macro checks `primitive_vec_fast_path` before touching these types, so normal decode performance is unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Click to see raw report |
viviveevee
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vec int8/16/32/64,vec nat8/16/32/64,vec float32/64,vec bool)expect_type/wire_typeper element;deserialize_ignored_anythen misidentified the element type and corrupted the byte streamseed.deserialize, skipping only theadd_cost(3)call in the fast pathTest plan
primitive_vector_is_extra_argsintests/compatibility_vectors.rscovers the exact failure scenariocompatibility_vectorstests continue to pass🤖 Generated with Claude Code